package ksv.cron;

import ksv.cron.v1.CronCallback;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.LinkedList;
import java.util.List;

/**
 * @创建人 xiaojiancheng
 * @时间 2020/9/26
 * @描述 $
 */
@ConfigurationProperties(prefix = "cron-config")
@Component
@Setter
@Getter
public class CronConfig {
    /**
     *  {@link #hashCapacity}   hash的容量
     *  {@link #hashList}       注册的hash节点
     *  {@link #tryAgain}       失败重试次数
     *
     *  {@link #threadCount}    线程数量
     *  {@link #callWay}        回调的方式 {@link CronCallback#type()} 待定
     */
    private int hashCapacity = 1;
    private List<Integer> hashList = new LinkedList<>();
    private int tryAgain = 4;

    private int threadCount = 8;
    private String callWay = CronCst.CallWay.HTTP;

    private int loadCronFrequency = 30;
}
